<extend name="Public:base" />
<block name="header_js">
	
</block>

<block name="content">
	<div class="row">
		<div class="col-lg-12">
			<h3 class="page-header"><em class="glyphicon glyphicon-edit"></em> 
			采集单页
		    </h3>
		</div>
		
	</div>


	<div class="row">
		<div class="col-lg-12">

				<form method="post" class="form-horizontal" id="form_do" name="form_do" action="{:U('page')}">											
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">网站域名</label>
						<div class="col-sm-9">
							<input type="text" name="site" id="inputSite" value="{$vo.site}" class="form-control" placeholder="网站域名" />									
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">单页地址</label>
						<div class="col-sm-9">
							<input type="text" name="url" id="inputUrl" value="{$vo.url}" class="form-control" placeholder="单页地址" />									
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">所属栏目</label>
						<div class="col-sm-9">
						<select name="cid" >
                            <option value="0">请选择</option>
                            <foreach name='cate' item='v'>
                            <option value="{$v.id}" <if condition="$vo.cid eq $v['id']">selected="selected"</if>>{$v.delimiter}{$v.name}</option>
                            </foreach>
                        </select>								
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">页面后缀</label>
						<div class="col-sm-9">
							<input type="text" name="ext" id="inputColor" value="{$vo.ext}" class="form-control  iColorPicker" placeholder="页面后缀，例如：.html">
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">标题匹配规则</label>
						<div class="col-sm-9">
							<textarea name="titlepreg" id="inputDescription" class="form-control">{$vo.titlepreg}</textarea>		
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">关键词匹配规则</label>
						<div class="col-sm-9">
							<textarea name="keypreg" id="inputKeypreg" class="form-control">{$vo.keypreg}</textarea>		
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">正文匹配规则</label>
						<div class="col-sm-9">
							<textarea name="contentpreg" id="inputDescription" class="form-control">{$vo.contentpreg}</textarea>	
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">图片采集方式</label>
						<div class="col-sm-9">
							<label class="radio-inline">
							 	<input type="radio" name="type" value="1" <if condition="$vo['type'] eq 1">checked="checked"</if> />curl方式				
							 </label>
							<label class="radio-inline">
							 	<input type="radio" name="type" value="0" <if condition="$vo['type'] eq 0">checked="checked"</if> />ob_get_contents方式&nbsp;&nbsp;
                                （提示：如果采集不到图片或者采集的图片损坏请选用ob_get_contents方式）
							 </label>	
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">图片匹配规则</label>
						<div class="col-sm-9">
							<textarea name="picpreg" id="inputDescription" class="form-control">{$vo.picpreg}</textarea>	
						</div>
					</div>
                    
                    <div class="form-group">
						<label for="inputUrl" class="col-sm-2 control-label">图片分页参数</label>
						<div class="col-sm-9">
							<input type="text" name="picpage" id="inputColor" value="{$vo.picpage}" class="form-control iColorPicker" placeholder="图片分页参数">
						</div>
					</div>
					
					<div class="row margin-botton-large">
						<div class="col-sm-offset-2 col-sm-9">
							<div class="btn-group">
								<button type="submit" class="btn btn-primary"> <i class="glyphicon glyphicon-saved"></i>
									保存
								</button>
								<button type="button" onclick="caiji();" class="btn btn-default" style="margin-left:30px;"> 
									立即采集 <i class="glyphicon glyphicon-chevron-right"></i>
								</button>
							</div>
						</div>
					</div>
				</form>
				<script language="javascript">
					function caiji(){
						$("#form_do").attr("action", "{:U('get_content')}");
						$('#form_do').submit();
					}
				</script>
		</div>
	</div>

		


</block>